import { createRouter, createWebHashHistory,createWebHistory } from 'vue-router'


//路由配置 源文件
const routes =[
    {
        path:'/',
        name:'moveCar',
        component:()=>import('../views/MoveCar.vue'),
        //useFrame 默认是全屏展示
        meta:{title:'移动端首页',icon:'',show:false,useFrame:true}
    },
    {
        path:'/downApp',
        name:'downApp',
        component:()=>import('../views/DownApp.vue'),
         meta:{title:'下载页面',icon:'',show:false,useFrame:true}
        
    },
    {
        path:'/searchs',
        name:'searchs',
        component:()=>import('../views/Searchs.vue'),
         meta:{title:'搜索页面',icon:'',show:false,useFrame:true}
    },
    {
        path:'/toplist',
        name:'toplist',
        component:()=>import('../views/tablist/Toplist.vue'),
         meta:{title:'排行榜页面',icon:'',show:false,useFrame:true}
    },
    {
        path:'/videodetail',
        name:'videodetail',
        component:()=>import('../views/tablist/Videodetail.vue'),
         meta:{title:'视频详情页面',icon:'',show:false,useFrame:true}
    },
    {
        path:'/viodehome',
        name:'home',
        component:()=>import('../views/homeView/Home.vue'),
        meta:{title:'首页',icon:'',show:false,useFrame:false},
    },
    {
        path:'/home',
        name:'home',
        component:()=>import('../views/homeView/Index.vue'),
        meta:{title:'首页',icon:'House',show:true,useFrame:false},
    },
    {
        path:'/carvideo',
        component:()=>import('../views/carVideo/Index.vue'),
        meta:{title:'视频管理',icon:'DataBoard',show:true,useFrame:false},
        children:[
            {
                path:'/carvideo/list',
                name:'carvideoList',
                component:()=>import('../views/carVideo/List.vue'),
                meta:{title:'视频列表',icon:'List',show:true,useFrame:false}
            },
            {
                path:'/carvideo/add',
                name:'carvideoAdd',
                component:()=>import('../views/carVideo/Add.vue'),
                meta:{title:'添加视频',icon:'Plus',show:true,useFrame:false}
            },
            {
                path:'/carvideo/edit/:id',
                name:'carvideoEdit',
                component:()=>import('../views/carVideo/Edit.vue'),
                meta:{title:'编辑视频',icon:'Edit',show:false,useFrame:false}
            }
        ]
    }
]
// 创建路由实例对象
const router =createRouter({
    // history:createWebHashHistory(),  hash模式 url路径包含#号，不美观
     history:createWebHistory(),
    routes
})
//导出路由对象
export default router





